package com.harisucici.websocketlib.room;


import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.Query;
import androidx.room.Update;

import com.harisucici.websocketlib.entities.receive.MyFriends;

import java.util.List;

@Dao
public abstract class MyFriendsDao {
    @Insert
    public abstract void insertPerson(MyFriends entity);

    @Update
    public abstract void updatePerson(MyFriends entity);

    @Delete
    public abstract void deletePerson(MyFriends entity);

    @Query("delete from MyFriends")
    public abstract void deleteAll();

    @Query("select * from MyFriends")
    public abstract List<MyFriends> listPeople();

    @Query("select * from MyFriends where userName=:userName")
    public abstract List<MyFriends> findPeopleByName(String userName);

    @Query("select * from MyFriends where timelineId=:timelineId")
    public abstract MyFriends findPersonByTimeline(String timelineId);


}
